<?php

include_once( '../api/session.php' );

require_once( '../api/Client.class.php' );

include_once( '../library/config.php' );
include_once( APPLICATION.'User.class.php' );
include_once( APPLICATION.'Payment.class.php' );
include_once( APPLICATION.'Paymentrequest.class.php' );

$pname = 'JaPagoJo';

include_once( 'templates/header.tmp.php' );

if( isset( $_GET['idp'] ) && isset( $_GET['email'] ) ) {
  $p = new Payment( $_GET['idp'] );
  $pr = Paymentrequest::findByEmailAndIdPayment( $_GET['email'], $_GET['idp'] );
  
  if( isset( $_SESSION['token'] ) )
	  include_once( 'templates/pay_info.tmp.php' );
	else
	  include_once( 'templates/pay_info.tmp.php' );
} else
  echo 'falten dades del pagament';

include_once( 'templates/footer.tmp.php' );
?>